package net.kengo.volleyball.scheduler.data;

import java.io.*;
import java.util.*;

public class Scheduler extends ArrayList
{
   public Scheduler()
   {
      super();
   }

   /*
   public void add( Match m )
   {
      super.put( m, m );
   }
   */

   public String printHeader()
   {
      String html = new String();

      html += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
      html += "<html>\n";
      html += "  <head>\n";
      html += "    <title></title>\n";
      html += "  </head>\n";
      html += "\n";
      html += "  <body>\n";
      html += "    <h1></h1>\n";
      html += "\n";
      html += "    <Table BORDER=1 ALIGN=center width=80%>\n";
      html += "        <TR BGCOLOR=\"#000088\">\n";

      html += "          <TD width=20% COLOR=\"#FFFFFF\">\n";
      html += "            <center><font color=\"#ffffff\"><b>\n";
      html += "              Week #\n";
      html += "            </b></font></center>\n";
      html += "          </TD>\n";

      html += "          <TD width=20%>\n";
      html += "            <center><font color=\"#ffffff\"><b>\n";
      html += "              Day\n";
      html += "            </b></font></center>\n";
      html += "          </TD>\n";

      html += "          <TD width=20%>\n";
      html += "            <center><font color=\"#ffffff\"><b>\n";
      html += "              Date\n";
      html += "            </b></font></center>\n";
      html += "          </TD>\n";

      html += "          <TD width=20%>\n";
      html += "            <center><font color=\"#ffffff\"><b>\n";
      html += "              Court #\n";
      html += "            </b></font></center>\n";
      html += "          </TD>\n";

      html += "          <TD width=20%>\n";
      html += "            <center><font color=\"#ffffff\"><b>\n";
      html += "              Opponent\n";
      html += "            </b></font></center>\n";
      html += "          </TD>\n";

      html += "        </TR>\n";

      return html;
   }


   public String toString()
   {
      String html = printHeader();

      Week[] weeks = (Week[])super.toArray( new Week[]{} );

      Week week = null;
      for ( int ii=0; ii<weeks.length; ii++ )
      {
         html += weeks[ii];
      }

      html += "    </Table>\n";
      html += "  </body>\n";

      return html;
   }

}